package com.th.common.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 路由类型枚举
 * @Author tuhang
 * @PackageName nswcy-crowdsource-back
 * @Package com.th.common.enums
 * @Date 2022/9/19 23:06
 * @Version 1.0
 */
@Getter
@AllArgsConstructor
public enum RouteType {

    BACKSTAGE(1, "后台路由"),
    FRONTDESK(2, "前台路由"),
    INDEPENDENT(3, "独立路由");

    private Integer code;
    private String info;

    /**
     * 路由类型枚举 检索
     * @param code
     * @return
     */
    public static RouteType of(Integer code){
        return Arrays.stream(values()).filter(item -> item.code.equals(code)).findAny().orElse(null);
    }

}
